﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Assessment.Management.SharedComponent.Params.ManagerParam;
using Assessment.Management.SharedComponent.Constants;
using Assessment.Management.SharedComponent.Entities;


namespace Assessment.Management.DAO.CommonManagers
{
    public class DepartmentDAO : BaseDaos
    {
        public DepartmentDAO()
            : base()
        {
        }

        public void GetListDepartment(DepartmentParam param)
        {

            string query = "Select * from Departments where Deleted=@Deleted";

            var cmd = base.GetSqlCommand();
            cmd.CommandText = query;
            cmd.Parameters.AddWithValue("@Deleted", SMX.smx_IsNotDeleted);
            try
            {
                param.listDepartment = base.ExecuteQueryGetListObject<Department>(cmd);
            }
            finally
            {
                base.CloseConnection(cmd);
            }
        }
    }
}
